import os
import asyncio
import ctypes, sys
def is_admin():
    try:
        return ctypes.windll.shell32.IsUserAnAdmin()
    except:
        return False
def admin_exe() :
    if is_admin():
        os.system('handle\handle.exe -a "BaseNamedObjects\{{239B7D43-86D5-4E5C-ADE6-CEC42155B475}}DingTalk" > 1.txt')
        os.system('for /f "tokens=2,3 delims=:" %i in (1.txt) do ( echo %i %j >> 2.txt )')
        os.system('for /f "tokens=1,4 delims= " %i in (2.txt) do ( echo %i %j >> 3.txt && handle\handle.exe -p %i -c %j -y)')
    else:
        if sys.version_info[0] == 3:
            ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, __file__, None, 1)
async def removetxt():
    os.remove("1.txt")
    os.remove("2.txt")
    os.remove("3.txt")
    return 0
coro = removetxt()
loop = asyncio.get_event_loop()
task = loop.create_task(coro)
admin_exe()